<?php
/**
 * Array of dependency definition for import / export
 * aDependence = defines child-table to export if parent is requested
 *               child are retrieved with parent key
 * aRelation = defines table related
 *             structure:
 *             <parent> => <child> => <parent key attribute> => <parent child attribute>
 * 
 * La struttura delle chiavi primarie delle entity @ definita nel file aStructMB.const.php
 * generato automaticamente da gen_dbimage.php contestualmente alla generreqtype
 * del file dbImage.txt
 */
$aDependence = array();
$aRelation = array();
// ------- process_unit (selectable)
$aDependence['process_unit'] = array(
		'process_unit_doc',
		'pu_alias',
		'pu_attribute',
		'pu_variable',
		'pu_link',
		'entry_point',
		'entry_point_alias',
		'entry_point_alias_match',
		'entry_point_attribute',
		'entry_point_rule',
		'entry_point_rule_attribute',
		'entry_point_variable',
		'frame',
		'frame_alias_match'
);
// attention !  parentn keys in aRelation must be in same order as in aDependence
$aRelation['process_unit']['module'] = array('module'=>'module');
$aRelation['process_unit']['sub_module'] = array('module'=>'module','sub_module'=>'sub_module');
$aRelation['frame']['layout_set'] = array('layout_set'=>'layout_set');
$aRelation['pu_alias']['entity'] = array('entity'=>'entity');
$aRelation['entry_point_rule']['com_rule'] = array('module'=>'module', 'com_rule_name'=>'name');

//------- module
$aDependence['module'] = array(
		'module_doc',
		'functional_area'
);

//------- layout
$aDependence['layout'] = array(
		'layout_alias',
		'layout_variable',
		'layout_band',
		'layout_field'
);
$aRelation['layout_alias']['entity'] = array('entity'=>'entity');

//------- entity (selectable)
$aDependence['entity'] = array(
		'attribute',
		'subject_area_entity'
);
$aRelation['entity']['data_area'] = array('data_area'=>'data_area');
$aRelation['subject_area_entity']['subject_area'] = array('data_area'=>'data_area','subject_area'=>'subject_area');
$aRelation['attribute']['domain'] = array('domain'=>'domain');

//------- data_area
$aDependence['data_area'] = array(
		'data_area_doc'
);

// ------ domain (selectable)
$aDependence['domain'] = array(
		'domain_value'
);

// ----- relationship
$aDependence['relationship'] = array(
		'relationship_key'
);

// ----- library
$aDependence['library'] = array(
		'function'
);

// ----- function
$aDependence['function'] = array(
		'function_variable'
);

// ----- menu_page
$aDependence['menu_page'] = array(
		'menu_group',
		'menu_line'
);
$aRelation['menu_page']['module'] = array('module'=>'module');
//$aRelation['menu_line']['process_unit'] = array('process_unit'=>'process_unit');
$aRelation['menu_line']['menu_page'] = array('linked_module'=>'module','linked_page'=>'menu_page');

// ----- com_rule
$aDependence['com_rule'] = array(
		'com_rule_alias',
		'com_rule_variable'
);
$aRelation['com_rule']['module'] = array('module'=>'module');
